<div class="authorlinks form">
<?php echo $this->Form->create('Record', array('action' => 'addrecord', 'target' => '_blank')); ?>
	<fieldset>
		<legend><?php echo __('Добавить новую запись'); ?></legend>
	<?php
		echo $this->Form->input('recordtype_id', array('label' => '', 'empty' => 'Выберите тип записи'));
	?>
	</fieldset>
	<br />
<?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="records view">
<h2><?php echo __('Записи пользователя'); ?></h2>
<?php 
	foreach ($all_records as $records):
		if (empty($records['records'])) {
			continue;
		}
		echo '<h3>'.$records['Recordtype'].'</h3>';
		$tmp_records = $records['records'];
		$count_edit = 0;
		$count_send = 0;
		$count_cancelled = 0;
		$count_approved = 0;
		
		echo '<table width="100%" cellpadding="0" cellspacing="0">';
		// проверка если выводим первую запись то сначала выводим заголовок таблицы
		$is_first_record_in_list = true;
		foreach ($tmp_records as $record):
			//*****************************************************************************************
			//+(int) 100 => '1.1 Учебно-теоретические издания',\
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 100) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип издания</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Booktype']['name'].'</td>';
					echo '<td>'.$record['Book']['book_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
						echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Book']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'view/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'delete'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'send'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
					// НЕ ВЛАДЕЛЕЦ
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));						
						}
					}
					echo '</td>';
					echo '</tr>';			
			}
			//*****************************************************************************************
			//+(int) 200 => '1.2 Учебно-практические издания',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 200) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип издания</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
										
					echo '<tr>';
					echo '<td>'.$record['Booktype']['name'].'</td>';
					echo '<td>'.$record['Book']['book_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Book']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи

						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'view/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'delete'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'send'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ		
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
						}			
					}					
					echo '</td>';
					echo '</tr>';
			}			
			//*****************************************************************************************
			//+(int) 300 => '1.3  Учебно-методические издания',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 300) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип издания</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;					
					echo '<tr>';
					echo '<td>'.$record['Booktype']['name'].'</td>';
					echo '<td>'.$record['Book']['book_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Book']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
 
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'view/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'delete'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'send'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ		
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						}
						else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					}					
					echo '</td>';
					echo '</tr>';
			}			
			//*****************************************************************************************
			//+(int) 400 => '1.4  Монографии',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 400) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип издания</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Booktype']['name'].'</td>';
					echo '<td>'.$record['Book']['book_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Book']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи

						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'view/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'delete'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Book', array('action' => 'send'));
							echo $this->Form->hidden('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ		
						if ($record['Book']['recstatus_id'] == 1 || $record['Book']['recstatus_id'] == 3) {
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Book', array('action' => 'simpleview/'.$record['Book']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Book']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
				echo '</td>';
				echo '</tr>';
					
			}		
			//*****************************************************************************************
			//+(int) 500 => '1.5 Защита кандидатской диссертации'
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 500) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип диссертации</th>';
					echo '<th>Специальность</th>';
					echo '<th>Название</th>';
					echo '<th>Дата защиты</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;				

					echo '<tr>';
					echo '<td>'.$record['Dissertype']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['profession_name'].'</td>';
					echo '<td>'.$record['Dissertation']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['defdate'].'</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
						if ($record['Dissertation']['recstatus_id'] == 1 || $record['Dissertation']['recstatus_id'] == 3) {
							echo $this->Form->create('Dissertation', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'view/'.$record['Dissertation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Удалить'));						
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Dissertation', array('action' => 'simpleview/'.$record['Dissertation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					}
					// соавторов для этой записи этого типа НЕТ			
					echo '</td>';
					echo '</tr>';
			}		

			//*****************************************************************************************
			//+(int) 600 => '1.6 Защита докторской диссертации'
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 600) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип диссертации</th>';
					echo '<th>Специальность</th>';
					echo '<th>Название</th>';
					echo '<th>Дата защиты</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Dissertype']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['profession_name'].'</td>';
					echo '<td>'.$record['Dissertation']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['defdate'].'</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Dissertation']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи					
						if ($record['Dissertation']['recstatus_id'] == 1 || $record['Dissertation']['recstatus_id'] == 3) {
							echo $this->Form->create('Dissertation', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'view/'.$record['Dissertation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Dissertation', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Dissertation', array('action' => 'simpleview/'.$record['Dissertation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Dissertation']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} 
					// соавторов для записи этого типа НЕТ					
					echo '</td>';
					echo '</tr>';
				 
			}
				
			//*****************************************************************************************
			//+(int) 700 => '1.7 Руководство кандидатской диссертацией',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 700) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип диссертации</th>';
					echo '<th>ФИО аспиранта</th>';
					echo '<th>Название</th>';
					echo '<th>Дата защиты</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Dissertype']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['aspirant_fio'].'</td>';
					echo '<td>'.$record['Disserleading']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['defdate'].'</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи					
						if ($record['Disserleading']['recstatus_id'] == 1 || $record['Disserleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Disserleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'view/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ		
						if ($record['Disserleading']['recstatus_id'] == 1 || $record['Disserleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}									
					}					
					echo '</td>';
					echo '</tr>';
				
			}

			//*****************************************************************************************
			//+(int) 800 => '1.8 Консультирование докторской диссертации',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 800) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип диссертации</th>';
					echo '<th>ФИО аспиранта</th>';
					echo '<th>Название</th>';
					echo '<th>Дата защиты</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Dissertype']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['aspirant_fio'].'</td>';
					echo '<td>'.$record['Disserleading']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['defdate'].'</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Disserleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи					

						if ($record['Disserleading']['recstatus_id'] == 1 || $record['Disserleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Disserleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'view/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Disserleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ
						if ($record['Disserleading']['recstatus_id'] == 1 || $record['Disserleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Disserleading', array('action' => 'simpleview/'.$record['Disserleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Disserleading']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					}					
					echo '</td>';
					echo '</tr>';
			}	

			//*****************************************************************************************
			//+(int) 900 => '1.9 Выступления с докладами',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 900) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип конференции</th>';
					echo '<th>Уровень конференции</th>';
					echo '<th>Название конференции</th>';
					echo '<th>Название доклада</th>';
					echo '<th>Соавторы</th>';	
					echo '<th>Статус записи</th>';									
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;					
					
					echo '<tr>';
					echo '<td>'.$record['Conferencetype']['name'].'</td>';
					echo '<td>'.$record['Conferenceleveltype']['name'].'</td>';
					echo '<td>'.$record['Conferencereport']['conference_name'].'</td>';
					echo '<td>'.$record['Conferencereport']['report_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Conferencereport']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи					

						if ($record['Conferencereport']['recstatus_id'] == 1 || $record['Conferencereport']['recstatus_id'] == 3) {
							echo $this->Form->create('Conferencereport', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'view/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ
						if ($record['Conferencereport']['recstatus_id'] == 1 || $record['Conferencereport']['recstatus_id'] == 3) {
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}					
					}					
					echo '</td>';
					echo '</tr>';

			}

			//*****************************************************************************************
			//+(int) 1000 => '1.10 Руководство студентами выступившими с докладами',
			//*****************************************************************************************
			if ($records['Recordtype_id'] == 1000) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип конференции</th>';
					echo '<th>Уровень конференции</th>';
					echo '<th>Название конференции</th>';
					echo '<th>Название доклада</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;					
					
					echo '<tr>';
					echo '<td>'.$record['Conferencetype']['name'].'</td>';
					echo '<td>'.$record['Conferenceleveltype']['name'].'</td>';
					echo '<td>'.$record['Conferencereport']['conference_name'].'</td>';
					echo '<td>'.$record['Conferencereport']['report_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Conferencereport']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи					

						if ($record['Conferencereport']['recstatus_id'] == 1 || $record['Conferencereport']['recstatus_id'] == 3) {
							echo $this->Form->create('Conferencereport', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'view/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Conferencereport', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ			
						if ($record['Conferencereport']['recstatus_id'] == 1 || $record['Conferencereport']['recstatus_id'] == 3) {	
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Conferencereport', array('action' => 'simpleview/'.$record['Conferencereport']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Conferencereport']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}	
					}					
					echo '</td>';
					echo '</tr>';
			}
			/** *************************************************************************************************** **/
			//+(int) 1100 => '1.11 Статьи в журналах по учебно-методической и научной работе',
			/** *************************************************************************************************** **/

			if ($records['Recordtype_id'] == 1100) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип статьи</th>';
					echo '<th>Название журнала</th>';
					echo '<th>Название статьи</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
				
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;					
				
					echo '<tr>';
					echo '<td>'.$record['Articletype']['name'].'</td>';
					echo '<td>'.$record['Article']['journal_name'].'</td>';
					echo '<td>'.$record['Article']['article_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Article']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'view/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ	
						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							/*************************/
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}								
					}
					echo '</td>';
					echo '</tr>';
			}			

			/** *************************************************************************************************** **/
			//+(int) 1200 => '1.12 Статьи в журналах по учебно-методической и научной работе в соавторстве с зарубежными учеными',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1200) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип статьи</th>';
					echo '<th>Название журнала</th>';
					echo '<th>Название статьи</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Articletype']['name'].'</td>';
					echo '<td>'.$record['Article']['journal_name'].'</td>';
					echo '<td>'.$record['Article']['article_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Article']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи

						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'view/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ
						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}					
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 1300 => '1.13 Статьи в журналах по научной работе с участием студентов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1300) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип статьи</th>';
					echo '<th>Название журнала</th>';
					echo '<th>Название статьи</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					echo '<tr>';
					echo '<td>'.$record['Articletype']['name'].'</td>';
					echo '<td>'.$record['Article']['journal_name'].'</td>';
					echo '<td>'.$record['Article']['article_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Article']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи

						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'view/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Article', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						// НЕ ВЛАДЕЛЕЦ
						if ($record['Article']['recstatus_id'] == 1 || $record['Article']['recstatus_id'] == 3) {
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));
							
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));							
						}	else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Article', array('action' => 'simpleview/'.$record['Article']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Article']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}					
					}
					echo '</td>';
					echo '</tr>';
			}
						
			/** *************************************************************************************************** **/
			//+(int) 1400 => '1.14 Публикации без студентов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1400) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип публикации</th>';
					echo '<th>Событие</th>';
					echo '<th>Название публикации</th>';;
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
				
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Publicationtype']['name'].'</td>';
					echo '<td>'.$record['Publication']['event_name'].'</td>';
					echo '<td>'.$record['Publication']['publication_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Publication']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
						if ($record['Publication']['recstatus_id'] == 1 || $record['Publication']['recstatus_id'] == 3) {
							echo $this->Form->create('Publication', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'view/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					} else {
						if ($record['Publication']['recstatus_id'] == 1 || $record['Publication']['recstatus_id'] == 3){
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					}
					echo '</td>';
					echo '</tr>';
			}
			
			/** *************************************************************************************************** **/
			//+(int) 1500 => '1.15 Публикации с участием студентов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1500) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип публикации</th>';
					echo '<th>Событие</th>';
					echo '<th>Название публикации</th>';;
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Publicationtype']['name'].'</td>';
					echo '<td>'.$record['Publication']['event_name'].'</td>';
					echo '<td>'.$record['Publication']['publication_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Publication']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
						// проверка статуса записи
						if ($record['Publication']['recstatus_id'] == 1 || $record['Publication']['recstatus_id'] == 3) {
							echo $this->Form->create('Publication', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'view/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Publication', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Publication']['recstatus_id'] == 1 || $record['Publication']['recstatus_id'] == 3) {
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Publication', array('action' => 'simpleview/'.$record['Publication']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Publication']['id']));
							echo $this->Form->end(__('Смотреть'));
						}

					}
					echo '</td>';
					echo '</tr>';
			}			

			
			/** *************************************************************************************************** **/
			//+(int) 1600 => '1.18 Членство в редколлегиях изданий',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1600) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип журнала</th>';
					echo '<th>Название журнала</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
								
					echo '<tr>';
					echo '<td>'.$record['Journaltype']['name'].'</td>';
					echo '<td>'.$record['Journaleditmember']['journalname'].'</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Journaleditmember']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {

						// проверка статуса записи
						if ($record['Journaleditmember']['recstatus_id'] == 1 || $record['Journaleditmember']['recstatus_id'] == 3) {
							echo $this->Form->create('Journaleditmember', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Journaleditmember', array('action' => 'view/'.$record['Journaleditmember']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Journaleditmember', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Journaleditmember', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Journaleditmember', array('action' => 'simpleview/'.$record['Journaleditmember']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
							echo 'Запись этого типа не может принадлежаить соавтору!';
						/* if ($record['Journaleditmember']['recstatus_id'] == 1 || $record['Journaleditmember']['recstatus_id'] == 3) {
							echo $this->Form->create('Journaleditmember', array('action' => 'simpleview/'.$record['Journaleditmember']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Journaleditmember', array('action' => 'simpleview/'.$record['Journaleditmember']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Journaleditmember']['id']));
							echo $this->Form->end(__('Смотреть'));							
						} */
					}
					echo '</td>';
					echo '</tr>';

			}
			
			/** *************************************************************************************************** **/
			//+(int) 1700 => '1.19 Открытия',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1700) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название открытия</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Discovery']['discovery_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Discovery']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Discovery']['recstatus_id'] == 1 || $record['Discovery']['recstatus_id'] == 3) {
							echo $this->Form->create('Discovery', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Discovery', array('action' => 'view/'.$record['Discovery']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Discovery', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Discovery', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Discovery', array('action' => 'simpleview/'.$record['Discovery']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Discovery']['recstatus_id'] == 1 || $record['Discovery']['recstatus_id'] == 3) {
							echo $this->Form->create('Discovery', array('action' => 'simpleview/'.$record['Discovery']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Discovery', array('action' => 'simpleview/'.$record['Discovery']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Discovery']['id']));
							echo $this->Form->end(__('Смотреть'));
						}

					}
					echo '</td>';
					echo '</tr>';

			}
			/** *************************************************************************************************** **/
			//+(int) 1800 => '1.20 Результаты интеллектуальной деятельности без студентов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 1800) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип интеллектуальной деятельности</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;	
									
					echo '<tr>';
					echo '<td>'.$record['Intellectworkresulttype']['name'].'</td>';
					echo '<td>'.$record['Intellectworkresult']['intellectwork_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Intellectworkresult']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {

						// проверка статуса записи
						if ($record['Intellectworkresult']['recstatus_id'] == 1 || $record['Intellectworkresult']['recstatus_id'] == 3) {
							echo $this->Form->create('Intellectworkresult', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'view/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Intellectworkresult']['recstatus_id'] == 1 || $record['Intellectworkresult']['recstatus_id'] == 3) {
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}						
			/** *************************************************************************************************** **/
			//+(int) 1900 => '1.21 Результаты интеллектуальной деятельности с участием студентов',
			/** *************************************************************************************************** **/
			
			if ($records['Recordtype_id'] == 1900) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип интеллектуальной деятельности</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
										
					echo '<tr>';
					echo '<td>'.$record['Intellectworkresulttype']['name'].'</td>';
					echo '<td>'.$record['Intellectworkresult']['intellectwork_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Intellectworkresult']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Intellectworkresult']['recstatus_id'] == 1 || $record['Intellectworkresult']['recstatus_id'] == 3) {
							echo $this->Form->create('Intellectworkresult', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'view/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Intellectworkresult', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Intellectworkresult']['recstatus_id'] == 1 || $record['Intellectworkresult']['recstatus_id'] == 3) {
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Intellectworkresult', array('action' => 'simpleview/'.$record['Intellectworkresult']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Intellectworkresult']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}

					}
					echo '</td>';
					echo '</tr>';
			}			
				
			/** *************************************************************************************************** **/
			//+(int) 2000 => '1.22 Новые лекарственные средства',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2000) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип лекарственного средства</th>';
					echo '<th>Название лекарственного средства</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;			
							
					echo '<tr>';
					echo '<td>'.$record['Newdrugtype']['name'].'</td>';
					echo '<td>'.$record['Newdrug']['drug_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Newdrug']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Newdrug']['recstatus_id'] == 1 || $record['Newdrug']['recstatus_id'] == 3) {
							echo $this->Form->create('Newdrug', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Newdrug', array('action' => 'view/'.$record['Newdrug']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Newdrug', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Newdrug', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Newdrug', array('action' => 'simpleview/'.$record['Newdrug']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Newdrug']['recstatus_id'] == 1 || $record['Newdrug']['recstatus_id'] == 3) {
							echo $this->Form->create('Newdrug', array('action' => 'simpleview/'.$record['Newdrug']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Newdrug', array('action' => 'simpleview/'.$record['Newdrug']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Newdrug']['id']));
							echo $this->Form->end(__('Смотреть'));
						}

					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2100 => '1.23 Гранты для КГМУ без студентов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2100) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название гранта</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;		
								
					echo '<tr>';
					echo '<td>'.$record['Grantleading']['grant_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Grantleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Grantleading']['recstatus_id'] == 1 || $record['Grantleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Grantleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'view/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Grantleading']['recstatus_id'] == 1 || $record['Grantleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}
				
			
			/** *************************************************************************************************** **/
			//+(int) 2200 => '1.24 Руководство грантами выигранными студентами',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2200) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название гранта</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					echo '<tr>';
					echo '<td>'.$record['Grantleading']['grant_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Grantleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Grantleading']['recstatus_id'] == 1 || $record['Grantleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Grantleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'view/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Grantleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Grantleading']['recstatus_id'] == 1 || $record['Grantleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Grantleading', array('action' => 'simpleview/'.$record['Grantleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Grantleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}

					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2300 => '1.25 Руководство дипломными работами',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2300) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип работы</th>';
					echo '<th>Название работы</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Studentworktype']['name'].'</td>';
					echo '<td>'.$record['Studentworkleading']['studentworkname'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Studentworkleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Studentworkleading']['recstatus_id'] == 1 || $record['Studentworkleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'view/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Studentworkleading']['recstatus_id'] == 1 || $record['Studentworkleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2400 => '1.26 Руководство курсовыми работами',
			/** *************************************************************************************************** **/
			
			if ($records['Recordtype_id'] == 2400) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип работы</th>';
					echo '<th>Название работы</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Studentworktype']['name'].'</td>';
					echo '<td>'.$record['Studentworkleading']['studentworkname'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Studentworkleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Studentworkleading']['recstatus_id'] == 1 || $record['Studentworkleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'view/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Studentworkleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Studentworkleading']['recstatus_id'] == 1 || $record['Studentworkleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkleading', array('action' => 'simpleview/'.$record['Studentworkleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2500 => '1.27 Руковдство студентами принявшими участие в конкурсах',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2500) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Конкурс</th>';
					echo '<th>Название работы</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Studentworkcompetitionleading']['competition_name'].'</td>';
					echo '<td>'.$record['Studentworkcompetitionleading']['studentwork_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Studentworkcompetitionleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Studentworkcompetitionleading']['recstatus_id'] == 1 || $record['Studentworkcompetitionleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'view/'.$record['Studentworkcompetitionleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'simpleview/'.$record['Studentworkcompetitionleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Studentworkcompetitionleading']['recstatus_id'] == 1 || $record['Studentworkcompetitionleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'simpleview/'.$record['Studentworkcompetitionleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Studentworkcompetitionleading', array('action' => 'simpleview/'.$record['Studentworkcompetitionleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Studentworkcompetitionleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2600 => '1.28 Поощрения студенческих работ',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2600) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Конкурс</th>';
					echo '<th>Название работы</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}

				// сбрасываем так как заголовок таблицы уже вывели
				$is_first_record_in_list = false;
				
					echo '<tr>';
					echo '<td>'.$record['Winningstudentworksleading']['competition_name'].'</td>';
					echo '<td>'.$record['Winningstudentworksleading']['studentwork_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Winningstudentworksleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Winningstudentworksleading']['recstatus_id'] == 1 || $record['Winningstudentworksleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'view/'.$record['Winningstudentworksleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'simpleview/'.$record['Winningstudentworksleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Winningstudentworksleading']['recstatus_id'] == 1 || $record['Winningstudentworksleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'simpleview/'.$record['Winningstudentworksleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Winningstudentworksleading', array('action' => 'simpleview/'.$record['Winningstudentworksleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningstudentworksleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2700 => '1.29 Руководство работой воспитательных структур',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2700) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название воспитательной структуры</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
										
					echo '<tr>';
					echo '<td>'.$record['Departmenteduleading']['edustructure_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Departmenteduleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Departmenteduleading']['recstatus_id'] == 1 || $record['Departmenteduleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Departmenteduleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Departmenteduleading', array('action' => 'view/'.$record['Departmenteduleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Departmenteduleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Departmenteduleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Departmenteduleading', array('action' => 'simpleview/'.$record['Departmenteduleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Departmenteduleading']['recstatus_id'] == 1 || $record['Departmenteduleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Departmenteduleading', array('action' => 'simpleview/'.$record['Departmenteduleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Departmenteduleading', array('action' => 'simpleview/'.$record['Departmenteduleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Departmenteduleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2800 => '1.30 Призовые места по итогам конкурсов',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2800) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название мероприятия</th>';
					echo '<th>Призовое место</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Winningplace']['competition_name'].'</td>';
					echo '<td>'.$record['Winningplace']['winningplace'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Winningplace']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Winningplace']['recstatus_id'] == 1 || $record['Winningplace']['recstatus_id'] == 3) {
							echo $this->Form->create('Winningplace', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Winningplace', array('action' => 'view/'.$record['Winningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Winningplace', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Winningplace', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Winningplace', array('action' => 'simpleview/'.$record['Winningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Winningplace']['recstatus_id'] == 1 || $record['Winningplace']['recstatus_id'] == 3) {
							echo $this->Form->create('Winningplace', array('action' => 'simpleview/'.$record['Winningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Winningplace', array('action' => 'simpleview/'.$record['Winningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Winningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 2900 => '1.31.1 Участие в физкультурно-массовой и спортивной работе: систематические занятия  в секциях',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 2900) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название секции</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;

					echo '<tr>';
					echo '<td>'.$record['Sportsection']['section_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Sportsection']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Sportsection']['recstatus_id'] == 1 || $record['Sportsection']['recstatus_id'] == 3) {
							echo $this->Form->create('Sportsection', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Sportsection', array('action' => 'view/'.$record['Sportsection']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Sportsection', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Sportsection', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Sportsection', array('action' => 'simpleview/'.$record['Sportsection']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Sportsection']['recstatus_id'] == 1 || $record['Sportsection']['recstatus_id'] == 3) {
							echo $this->Form->create('Sportsection', array('action' => 'simpleview/'.$record['Sportsection']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Sportsection', array('action' => 'simpleview/'.$record['Sportsection']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportsection']['id']));
							echo $this->Form->end(__('Смотреть'));							
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 3000 => '1.31.2 Участие в физкультурно-массовой и спортивной работе: участие в спартакиаде Бодрость и здоровье',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3000) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название соревнования</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
							
					echo '<tr>';
					echo '<td>'.$record['Sportcompetition']['competition_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Sportcompetition']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Sportcompetition']['recstatus_id'] == 1 || $record['Sportcompetition']['recstatus_id'] == 3) {
							echo $this->Form->create('Sportcompetition', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Sportcompetition', array('action' => 'view/'.$record['Sportcompetition']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Sportcompetition', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Sportcompetition', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Sportcompetition', array('action' => 'simpleview/'.$record['Sportcompetition']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Sportcompetition']['recstatus_id'] == 1 || $record['Sportcompetition']['recstatus_id'] == 3) {
							echo $this->Form->create('Sportcompetition', array('action' => 'simpleview/'.$record['Sportcompetition']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Sportcompetition', array('action' => 'simpleview/'.$record['Sportcompetition']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Sportcompetition']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			
			/** *************************************************************************************************** **/
			//+(int) 3100 => '2.1 Внедрение инновацинных педагогических технологий обучения и воспитания',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3100) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название пед. технологии</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Midpedintroduction']['introduction_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Midpedintroduction']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Midpedintroduction']['recstatus_id'] == 1 || $record['Midpedintroduction']['recstatus_id'] == 3) {
							echo $this->Form->create('Midpedintroduction', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Midpedintroduction', array('action' => 'view/'.$record['Midpedintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Midpedintroduction', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Midpedintroduction', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midpedintroduction', array('action' => 'simpleview/'.$record['Midpedintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Midpedintroduction']['recstatus_id'] == 1 || $record['Midpedintroduction']['recstatus_id'] == 3) {
							echo $this->Form->create('Midpedintroduction', array('action' => 'simpleview/'.$record['Midpedintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midpedintroduction', array('action' => 'simpleview/'.$record['Midpedintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midpedintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}
			/** *************************************************************************************************** **/
			//+(int) 3200 => '2.2 Призовые места по итогам конкурсов и смотров',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3200) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Призовое место</th>';
					echo '<th>Название соревнования</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;

					echo '<tr>';
					echo '<td>'.$record['Midwinningplacetype']['name'].'</td>';
					echo '<td>'.$record['Midwinningplace']['competition_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Midwinningplace']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Midwinningplace']['recstatus_id'] == 1 || $record['Midwinningplace']['recstatus_id'] == 3) {
							echo $this->Form->create('Midwinningplace', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Midwinningplace', array('action' => 'view/'.$record['Midwinningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Midwinningplace', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Midwinningplace', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midwinningplace', array('action' => 'simpleview/'.$record['Midwinningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Midwinningplace']['recstatus_id'] == 1 || $record['Midwinningplace']['recstatus_id'] == 3) {
							echo $this->Form->create('Midwinningplace', array('action' => 'simpleview/'.$record['Midwinningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midwinningplace', array('action' => 'simpleview/'.$record['Midwinningplace']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midwinningplace']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';

			}			
			/** *************************************************************************************************** **/
			//+(int) 3300 => '2.3 Аттестация преподавателей колледжа на высшую квалификационную категорию',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3300) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Дата аттестации</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Midhighattestation']['attestation_date'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Midhighattestation']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Midhighattestation']['recstatus_id'] == 1 || $record['Midhighattestation']['recstatus_id'] == 3) {
							echo $this->Form->create('Midhighattestation', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Midhighattestation', array('action' => 'view/'.$record['Midhighattestation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Midhighattestation', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Midhighattestation', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midhighattestation', array('action' => 'simpleview/'.$record['Midhighattestation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Midhighattestation']['recstatus_id'] == 1 || $record['Midhighattestation']['recstatus_id'] == 3) {
							echo $this->Form->create('Midhighattestation', array('action' => 'simpleview/'.$record['Midhighattestation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Midhighattestation', array('action' => 'simpleview/'.$record['Midhighattestation']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Midhighattestation']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';

			}			
			/** *************************************************************************************************** **/
			//+(int) 3400 => '3.1 Руководство работой региональных отделений научно-практических обществ',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3400) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название научно-практического общества</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Spcommunity']['name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Spcommunity']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Spcommunity']['recstatus_id'] == 1 || $record['Spcommunity']['recstatus_id'] == 3) {
							echo $this->Form->create('Spcommunity', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Spcommunity', array('action' => 'view/'.$record['Spcommunity']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Spcommunity', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Spcommunity', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Spcommunity', array('action' => 'simpleview/'.$record['Spcommunity']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Spcommunity']['recstatus_id'] == 1 || $record['Spcommunity']['recstatus_id'] == 3) {
							echo $this->Form->create('Spcommunity', array('action' => 'simpleview/'.$record['Spcommunity']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Spcommunity', array('action' => 'simpleview/'.$record['Spcommunity']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Spcommunity']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			/** *************************************************************************************************** **/
			//+(int) 3500 => '3.2 Выступления с докладами на заседаниях научных сообществ',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3500) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Название научно-практического общества</th>';
					echo '<th>Название доклада</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Medcommunityspeech']['community_name'].'</td>';
					echo '<td>'.$record['Medcommunityspeech']['speech_name'].'</td>';					
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Medcommunityspeech']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Medcommunityspeech']['recstatus_id'] == 1 || $record['Medcommunityspeech']['recstatus_id'] == 3) {
							echo $this->Form->create('Medcommunityspeech', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Medcommunityspeech', array('action' => 'view/'.$record['Medcommunityspeech']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Medcommunityspeech', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Medcommunityspeech', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Medcommunityspeech', array('action' => 'simpleview/'.$record['Medcommunityspeech']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Medcommunityspeech']['recstatus_id'] == 1 || $record['Medcommunityspeech']['recstatus_id'] == 3) {
							echo $this->Form->create('Medcommunityspeech', array('action' => 'simpleview/'.$record['Medcommunityspeech']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Medcommunityspeech', array('action' => 'simpleview/'.$record['Medcommunityspeech']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Medcommunityspeech']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';

			}			
			/** *************************************************************************************************** **/
			//+(int) 3600 => '3.3 Руководство в практическом здравоохранении',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3600) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип руководства</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
					
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Practicalhealthcaretype']['name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Practicalhealthcareleading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Practicalhealthcareleading']['recstatus_id'] == 1 || $record['Practicalhealthcareleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'view/'.$record['Practicalhealthcareleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'simpleview/'.$record['Practicalhealthcareleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Practicalhealthcareleading']['recstatus_id'] == 1 || $record['Practicalhealthcareleading']['recstatus_id'] == 3) {
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'simpleview/'.$record['Practicalhealthcareleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Practicalhealthcareleading', array('action' => 'simpleview/'.$record['Practicalhealthcareleading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Practicalhealthcareleading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			/** *************************************************************************************************** **/
			//+(int) 3700 => '3.4 Выполнение леченой нагрузки за год',
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3700) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Год выполнения лечебной нагрузки</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					echo '<tr>';
					echo '<td>'.$record['Lpuyearmedicalloading']['yearloading'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Lpuyearmedicalloading']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {
 
						// проверка статуса записи
						if ($record['Lpuyearmedicalloading']['recstatus_id'] == 1 || $record['Lpuyearmedicalloading']['recstatus_id'] == 3) {
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'view/'.$record['Lpuyearmedicalloading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'simpleview/'.$record['Lpuyearmedicalloading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Lpuyearmedicalloading']['recstatus_id'] == 1 || $record['Lpuyearmedicalloading']['recstatus_id'] == 3) {
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'simpleview/'.$record['Lpuyearmedicalloading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Lpuyearmedicalloading', array('action' => 'simpleview/'.$record['Lpuyearmedicalloading']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuyearmedicalloading']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					}
					echo '</td>';
					echo '</tr>';
			}			
			/** *************************************************************************************************** **/
			//(int) 38 => '3.5 Внедрение в работу ЛПУ новых методов лечения, диагностики и др'
			/** *************************************************************************************************** **/
			if ($records['Recordtype_id'] == 3800) {
				switch ($record['Recstatus']['id']) {
					case 1: $count_edit++; break;
					case 2: $count_send++; break;
					case 3: $count_cancelled++; break;
					case 4: $count_approved++; break;
				}
				if ($is_first_record_in_list) {
					echo '<tr>';
					echo '<th>Тип внедрения</th>';
					echo '<th>Название</th>';
					echo '<th>Соавторы</th>';
					echo '<th>Статус записи</th>';
					echo '<th>Коментарий модератора</th>';
					echo '<th>Действия</th>';
					echo '</tr>';
				}	
					// сбрасываем так как заголовок таблицы уже вывели
					$is_first_record_in_list = false;
					
					echo '<tr>';
					echo '<td>'.$record['Lpuintroductiontype']['name'].'</td>';
					echo '<td>'.$record['Lpuintroduction']['introduction_name'].'</td>';
					echo '<td>';
					foreach ($record['authors'] as $author):
					echo $author.'<br />';
					endforeach;
					echo '</td>';
					echo '<td>'.$record['Recstatus']['name'].'</td>';
					echo '<td>'.$record['Lpuintroduction']['moderator_comment'].'</td>';
					echo '<td>';
					if ($record['Authorlink']['is_owner']) {

						// проверка статуса записи
						if ($record['Lpuintroduction']['recstatus_id'] == 1 || $record['Lpuintroduction']['recstatus_id'] == 3) {
							echo $this->Form->create('Lpuintroduction', array('action' => 'edit', 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->hidden('doedit', array('value' => 1));
							echo $this->Form->end(__('Изменить'));
							/*************************/
							echo $this->Form->create('Lpuintroduction', array('action' => 'view/'.$record['Lpuintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
							/*************************/
							echo $this->Form->create('Lpuintroduction', array('action' => 'delete'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Удалить'));
							/*************************/
							echo $this->Form->create('Lpuintroduction', array('action' => 'send'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Отправить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Lpuintroduction', array('action' => 'simpleview/'.$record['Lpuintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
						}
					} else {
						if ($record['Lpuintroduction']['recstatus_id'] == 1 || $record['Lpuintroduction']['recstatus_id'] == 3) {
							echo $this->Form->create('Lpuintroduction', array('action' => 'simpleview/'.$record['Lpuintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
							echo $this->Form->create('Authorlink', array('action' => 'approve/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Принять'));
							echo $this->Form->create('Authorlink', array('action' => 'cancel/'.$record['Authorlink']['id'], 'target' => '_blank'));
							echo $this->Form->end(__('Отклонить'));
						} else {
							echo $record['Recstatus']['name'];
							echo $this->Form->create('Lpuintroduction', array('action' => 'simpleview/'.$record['Lpuintroduction']['id'], 'target' => '_blank'));
							echo $this->Form->input('id', array('value' => $record['Lpuintroduction']['id']));
							echo $this->Form->end(__('Смотреть'));
						}

					}
					echo '</td>';
					echo '</tr>';
			}			
			
		endforeach;
		echo '</table>';
		echo '<h5>'.'Редактируется: '.$count_edit.' | '.'На рассмотрении: '.$count_send.' | '.'Отклонено: '.$count_cancelled.' | '.'Принято: '.$count_approved.'</h5>';
	endforeach;

	
?>
</div>